<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>申报系统</title>
    <link rel="stylesheet" href="cssase.css"/>
    <link rel="stylesheet" href="cssegister.css"/>
    <link rel="stylesheet" href="cssessage.css"/>
    <link rel="stylesheet" href="css/register.css"/>

</head>
<body>
    <div class='top'>
        <img onclick="goHome()" style="cursor:pointer;" src="img/logotext.png">&nbsp;|&nbsp;<span>欢迎注册</span>
    </div>
    <div class='qxm' id='steps1'>
        <!-- <div class="stepWrap">
            <ul class="steps">
                <li class="active">注册申请</li>
                <li class='grey'>填写基础信息</li>
                <li class='grey'>提交审核</li>
            </ul>
        </div> -->
        <div class="contWrap">
            <form id="registerForm" name='f' action='' method='POST'>
                <div class='inputWrapper form_control'>
                    <div class='sqname'>*
                        <span style='color:#444444'>用户名</span>
                    </div>
                    <Input placeholder='请输入用户名' id="entName" name="entName" class='qxmInput required' data-valid="isNonEmpty" data-error="请输入企业名称" />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>手机号（默认登录用户名）</span>
                    </div>
                    <Input placeholder='请输入手机号' id="mobile" data-valid="isNonEmpty||isMobile" data-error="请输入手机号||请输入正确的手机号" class='qxmInput required'
                    />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>联系Email</span>
                    </div>
                    <Input placeholder='请输入联系Email' id="email" data-valid="isNonEmpty||isEmail" data-error="请输入联系Email||请输入正确的联系Email" class='qxmInput required'
                    />
                </div>
                <div class='inputWrapper dx'>
                    <div class='sqname'>*
                        <span style='color:#444444'>Email验证码</span>
                    </div>
                    <Input style="width:340px;" placeholder='请输入Email验证码' id="smsCode" data-valid="isNonEmpty" data-error="请输入验证码" class='qxmInput required'
                    />
                    <button class="smsBtn" type="button" onclick="getCode(this)">获取Email验证码</button>
                </div>

                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>请输入密码</span>
                    </div>
                    <Input placeholder='请输入密码' id="pw1" name='pw1' class='qxmInput required' type="password" data-tip="请输入密码" data-valid="isNonEmpty||isPaws"
                        data-error="请输入密码||密码长度6-18位大小写字母加数字加特殊符号"/>
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444' type='password'>请再次输入密码</span>
                    </div>
                    <Input placeholder='请再次输入密码' id='pw2' name='pw2' class='qxmInput  required' data-valid="isNonEmpty||equalTo:pw1" type='password'
                        data-error="请输入密码||两次密码需要输入一致"/>
                </div>
            </form>
            <div class='buttondiv2' style="text-align:center;">
                <button class="nextBtn" type="button" onclick="nextTwo()">提交</button>
            </div>
            <div id="fullbg"></div>
            <!-- <div id="dialog">
                <div style='font-size:18px;color:#444444;padding:2rem;border-bottom:1px solid #dcdcdc;'>请完成安全验证</div>
                <div class="checkdiv checkdiv1" onclick="getXY()">
                    <img src="" class="checkimg" id="checkimg">
                    <div class="refreshdiv" onclick="refresh()">
                        <img src="img/refresh.png" class="refreshimg">
                    </div>
                </div>
                <div class="button" onclick="getcheckImg()">
                    <span class="buttontext" id="buttontext"></span>
                </div>
            </div> -->
        </div>
    </div>
    <!-- <div class='qxm' id='steps2' style="display:none">
        <div class="stepWrap">
            <ul class="steps2">
                <li class="done">注册申请</li>
                <li class='active'>填写基础信息</li>
                <li class='grey'>提交审核</li>
            </ul>
        </div>
        <div class="contWrap">
            <form id="step2From" name='step2From'>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>企业名称</span>
                    </div>
                    <Input disabled class='qxmInput required' name="entName" id="entName1" data-valid="isNonEmpty" data-error="请输入企业名称" />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>统一信用代码</span>
                    </div>
                    <Input disabled class='qxmInput required' name="entGeneralCreditCode" id="entGeneralCreditCode1" data-valid="isNonEmpty||isCreditCode" data-error="请输入统一信用代码||格式不正确"/>
                </div>
    
    
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>公司类型</span>
                    </div>
                    <select id="companyType" name="companyType" id="companyTypeValue" class='required' data-valid="isNonEmpty" data-error="*请选择">
                        <option value="">请选择</option>
                    </select>
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>经营状态</span>
                    </div>
                    <select name="managementState" id="managementState" class='required' data-valid="isNonEmpty" data-error="*请选择">
                        <option value="">请选择</option>
                    </select>
                    
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>成立日期</span>
                    </div>
                    <Input readonly="readonly" placeholder='请填写成立日期' name="foundation" id="foundation" class='layui-input dateInput required' style='line-height:8rem;' data-valid="isNonEmpty"
                        data-error="请填写成立日期" />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>营业期限</span>
                    </div>
                    <Input placeholder='请输入营业期限' class='layui-input dateInput2 required' name="businessTerm" id="businessTerm" data-valid="isNonEmpty" data-error="请输入营业期限" />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>发照日期</span>
                    </div>
                    <Input readonly="readonly" placeholder='请填写发照日期' class='layui-input dateInput required' name="dateIssue" id="dateIssue" style='line-height:8rem;' data-valid="isNonEmpty"
                        data-error="请填写发照日期" />
    
    
                </div>
                 <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>登记机关</span>
                    </div>
                    <Input placeholder='请填写登记机关' class='qxmInput required' name="registerOffice" id="registerOffice" style='line-height:8rem;' data-valid="isNonEmpty"
                        data-error="请填写登记机关" />
    
    
                </div>
                
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'> 法定代表人</span>
                    </div>
                    <Input placeholder='请填写法定代表人' class='qxmInput required' name="legalRepresentative" id="legalRepresentative" data-valid="isNonEmpty" data-error="请填写法定代表人" />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>法人证件号</span>
                    </div>
                    <Input placeholder='请填写法定代表人身份证号码' class='qxmInput required' name="legalpIdno" id="legalpIdno" data-valid="isNonEmpty||isIDCard" data-error="请填写法定代表人身份证号码||请填写正确的身份证号码"
                    />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>企业电话</span>
                    </div>
                    <Input placeholder='请填写企业电话' class='qxmInput required' name="entPhone" id="entPhone" data-valid="isNonEmpty" data-error="请填写企业电话"
                    />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>注册资本(万元)</span>
                    </div>
                    <Input placeholder='请填写注册资本' class='qxmInput required' name="registeredCapital" id="registeredCapital" data-valid="isNonEmpty||onlywNum" data-error="请填写注册资本||格式不正确" />
                </div>
                <div class='inputWrapper clearfix'>
                    <div class="inputWrap" style="float:left;width:220px">
                        <label><span>*</span>所在省</label>
                        <select class='required' id="entProvinceCodeValue" name="entProvinceCodeValue" onchange="oProvChange(this.value)" data-valid="isNonEmpty" data-error="*请选择">	
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="inputWrap" style="float:right;width:220px;">
                        <label><span>*</span>所在市</label>
                        <select name="countyName" id="countyName" class='' data-valid="isNonEmpty" data-error="*请选择">	
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>详细地址</span>
                    </div>
                    <Input placeholder='请填写企业详细地址' class='qxmInput required' name="businessAddress" id="businessAddress" data-valid="isNonEmpty" data-error="请填写企业详细地址" />
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>所属行业</span>
                    </div>
                    <select id="industry" name="industry" class='required' data-valid="isNonEmpty" data-error="*请选择">
                        <option value=''>请选择</option>
                    </select>
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>经营范围</span>
                    </div>
    
                    <textarea class='qxmTextarea required' placeholder='请填写经营范围' name="scope" id="scope" data-valid="isNonEmpty" data-error="请填写经营范围"></textarea>
                </div>
                <div class='inputWrapper'>
                    <div class='sqname'>*
                        <span style='color:#444444'>复工状态</span>
                    </div>
                    <select id="returnWorkStatusValue" name="returnWorkStatus" class='required' data-valid="isNonEmpty" data-error="*请选择">
                        <option value=''>请选择</option>
                    </select>
                </div>
            </form>
            <form id="fileForm" name="fileForm">
                <div style='display:flex;'>
                    <div style='text-align:center;width:33.3%;display:flex;flex-direction:column;'>
                        <div style='margin:1.9rem auto;'>
                            <div class="file-box clearboth" id="fileBox">
                                <label class="clone-dom">
                                    <input class="file-btn required" name="img[]" placeholder='请上传企业执照' />
                                </label>
    
                                <div class="review-box"></div>
                                <label class='xslabel'>
                                    <input type="file" class="file-btn clone-dom required" id="businessLicense" name="file" placeholder='请上传企业执照' />
                                </label>
                                
                            </div>
    
                        </div>
                        <div class='sqname'>*
                            <span style='color:#444444'>上传企业执照</span>
                        </div>
                        <div class="valid_message" id='msg1'></div>
                    </div>
                    <div style='text-align:center;width:33.3%;display:flex;flex-direction:column;'>
                        <div style='margin:1.9rem auto;'>
                            <div class="file-box1 clearboth" id="fileBox1">
                                <label class="clone-dom1">
                                    <input type="file" class="file-btn1" name="img[]" />
                                </label>
    
                                <div class="review-box1"></div>
                                <label class='xslabel1'>
                                    <input type="file" class="file-btn1 clone-dom1" name="img[]" id="legalpIdimgFront"/>
                                </label>
                            </div>
    
                        </div>
                        <div class='sqname'>*
                            <span style='color:#444444'>上传身份证正面</span>
                        </div>
                        <div class="valid_message" id='msg2'></div>
                    </div>
                    <div style='text-align:center;width:33.3%;display:flex;flex-direction:column;'>
                        <div style='margin:1.9rem auto;'>
                            <div class="file-box2 clearboth" id="fileBox2">
                                <label class="clone-dom2">
                                    <input type="file" class="file-btn2" name="img[]" />
                                </label>
    
                                <div class="review-box2"></div>
                                <label class='xslabel2'>
                                    <input type="file" class="file-btn2 clone-dom2" name="img[]" id="legalpIdimgReverse"/>
                                </label>
                            </div>
    
                        </div>
                        <div class='sqname'>*
                            <span style='color:#444444'>上传身份证反面</span>
                        </div>
                        <div class="valid_message" id='msg3'></div>
                    </div>
                    <input type="hidden" id="businessLicenseId"/>
                    <input type="hidden" id="businessLicensePath"/>
                    <input type="hidden" id="legalpIdimgFrontId"/>
                    <input type="hidden" id="legalpIdimgFrontPath"/>
                    <input type="hidden" id="legalpIdimgReverseId"/>
                    <input type="hidden" id="legalpIdimgReversePath"/>
                </div>
            </form>
             <div class="buttonWrap" style='text-align:center;margin-top:3rem;margin-bottom:5rem;'>
                <Button class='backB' onclick='toOne()'>上一步</Button>
                <Button class='submitB' onclick="submitData()" id='btn'>提交</Button>
            </div>
        </div>
        <div id="back"></div>
    </div> -->
    <script src="js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="js/layui/layui.js"></script>
    <script src="js/jquery-validate.js"></script>
    <script src="js/qklConfig.js"></script>
    <script src="js/register.js"></script>
    <script type="text/javascript" src="js/jssha256.js"></script>
    <script type="text/javascript" src="js/message.min.js"></script>
    <script src="plugins/axios/axios.min.js"></script>
    <script>
        $('form').validate({
            rules: {
                pw2: {
                    required: true,
                    equalTo: "#pw1"
                },
            },
            messages: {
                pw2: {
                    required: "请再次输入密码",
                    equalTo: "请再次输入相同的值"
                },
            },
            onFocus: function () {
                this.parent().addClass('active');
                return false;
            },
            onBlur: function () {
                var $parent = this.parent();
                var _status = parseInt(this.attr('data-status'));
                $parent.removeClass('active');
                if (!_status) {
                    $parent.addClass('error');
                }
                return false;
            }
        });
        $('form').on('submit', function (event) {
            event.preventDefault();
            $(this).validate('submitValidate'); //return boolean;
        });

        function nextTwo(){

            axios({
                method: 'post',
                url: 'http://localhost:8080/user/register',
                data:{
                    username: document.getElementById('entName').value,
                    mobile : document.getElementById('mobile').value,
                    email : document.getElementById('email').value,
                    password : document.getElementById('pw1').value,

                }

            }).then(function (res) {

                if(res.data.code === 1){
                    window.location.href="login.html"
                }else{
                    alert("注册失败")
                }
            })
        }

        function getCode(obj) {

            axios({
                method: 'get',
                url: 'http://localhost:8080/user/email',

            }).then(function (res) {

                if(res.data.code === 1){
                    alert(res.data.data)
                }else{
                    alert("失败")
                }
            })
        }
    </script>
</body>
</html>